.MODEL small
.STACK 200h
.DATA
	_error_overflow_double   DB   'Runtime Error : double Overflow$'
	_error_underflow_double  DB   'Runtime Error : double Underflow$'
	_error_overflow_int      DB   'Runtime Error : integer Overflow$'
	_error_underflow_int     DB   'Runtime Error : integer Underflow$'
	_error_div_by_zero       DB   'Runtime Error : Division by ZERO!!!$'
	_warninig_double         DB   'Runtime warning : double Value Trimmed$'
	FlagVar                  DW   ?
	varauxDouble             DQ   ?
	varauxInt                DW   ?
	_STR_1352833196 DB 'hola mundo!$'

.CODE

.386

	;PROCEDIMIENTO OVERFLOW DOUBLE
	doubleoverflow proc 
		jo error_doubleoverflow 
		ret 
	doubleoverflow endp 


	;PROCEDIMIENTO UNDERFLOW DOUBLE
	doubleunderflow proc 
		jo error_doubleunderflow 
		ret 
	doubleunderflow endp 


	;PROCEDIMIENTO OVERFLOW INT
	intoverflow proc 
		jo error_intoverflow 
		ret 
	intoverflow endp 


	;PROCEDIMIENTO UNDERFLOW INT
	intunderflow proc 
		jo error_intunderflow 
		ret 
	intunderflow endp 


	;PROCEDIMIENTO DIVISION POR CERO
	zerodiv proc 
		jz error_zerodiv 
		ret
	zerodiv endp


	;PROCEDIMIENTO PRINT
	print proc
		mov ah,09h
		int 21h
		ret
	print endp 


	warning_asig proc 
		mov dx,offset _warninig_double
		call print 
		ret
	warning_asig endp


	error_doubleoverflow:
		mov dx,offset _error_overflow_double 
		call print
		mov al,1h 
		jmp SYSCALL_END

	error_doubleunderflow:
		mov dx,offset _error_underflow_double 
		call print
		mov al,2h 
		jmp SYSCALL_END

	error_intoverflow:
		mov dx,offset _error_overflow_int 
		call print
		mov al,3h 
		jmp SYSCALL_END

	error_intunderflow:
		mov dx,offset _error_underflow_int 
		call print
		mov al,4h 
		jmp SYSCALL_END

	error_zerodiv:
		mov dx,offset _error_div_by_zero 
		call print
		mov al,5h 
		jmp SYSCALL_END

	START:
		mov ax,@data 
		mov ds,AX 
		finit
		fclex

	;--------------Comienzo de tercetos--------------


	;IL(0)=(PRINT,_STR_1352833196)
	; Comienzo de impresion
		MOV DX, offset  _STR_1352833196
		call print
	; Fin de impresion


	;IL(1)=(END_PROG)
	; Comienzo del Fin de Programa
	NORMAL_END :
		mov al, 00h
	SYSCALL_END:
		mov ah, 4Ch
		int 21h
	END START
	; Fin de Fin de Programa

	;--------------Fin de tercetos--------------
